package tum0r.generate_code.database.enums;

import java.util.ArrayList;

/**
 * 生成时间: 2021-05-20 20:17:15
 */
@SuppressWarnings("unused")
public enum UserFields {
    ID,
    Username,
    Password;

    private static ArrayList<UserFields> all = null;

    public static ArrayList<UserFields> getAll() {
        if (all == null) {
            all = new ArrayList<>();
            all.add(ID);
            all.add(Username);
            all.add(Password);
        }
        return all;
    }

    public static UserFields[] getAllArray(){
        return getAll().toArray(new UserFields[0]);
    }

    public static ArrayList<UserFields> except(UserFields... fields) {
        ArrayList<UserFields> result = new ArrayList<>(getAll());
        if (fields != null && fields.length != 0) {
            for (UserFields field : fields) {
                result.remove(field);
            }
        }
        return result;
    }
}
